package gestion.camping.vue;

import gestion.camping.dto.Emplacement;

import java.util.List;

import javax.swing.table.DefaultTableModel;

public class TableEmplacementModel extends DefaultTableModel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public TableEmplacementModel(List<Emplacement> listEmplacement, String [] columnNames) {
		super(columnNames, 0);
      
  		if(listEmplacement != null){
		    for(Emplacement emplacement : listEmplacement){
		    	String[] emplacementData ={String.valueOf(emplacement.getId()), 
		    							   emplacement.getSecteur().getLibelle(), 
		    							   emplacement.getTypeTerrain().getLibelle() };
				
		    	addRow(emplacementData);
		    }
  		}
    }
	
	@Override
	public boolean isCellEditable(int row, int col) {
		return false;
	}
}

